﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:Controls="clr-namespace:WPFMediaKit.DirectShow.Controls">
    <Style TargetType="{x:Type Controls:MediaDetectorElement}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Controls:MediaDetectorElement}">
                    <ControlTemplate.Resources>
                        <DataTemplate x:Key="VideoFrameDataTemplate">
                            <Grid Width="180"
                                  Height="100">
                                <Border CornerRadius="2"
                                        BorderBrush="#AA000000"
                                        BorderThickness="1,1,0,0"
                                        VerticalAlignment="Center"
                                        HorizontalAlignment="Center"
                                        Width="150"
                                        Height="80"
                                        Background="#33000000">
                                    <Grid>
                                        <Border CornerRadius="2"
                                                BorderBrush="#AA888888"
                                                BorderThickness="0,0,1,1"
                                                VerticalAlignment="Center"
                                                HorizontalAlignment="Center">
                                            <Image Source="{Binding Path=Snapshot}" />
                                        </Border>
                                        <TextBlock Text="{Binding Path=MediaTime}"
                                                   Foreground="Black"
                                                   FontSize="11"
                                                   HorizontalAlignment="Center"
                                                   VerticalAlignment="Bottom" />
                                        <TextBlock Text="{Binding Path=MediaTime}"
                                                   Foreground="White"
                                                   FontSize="11"
                                                   HorizontalAlignment="Center"
                                                   VerticalAlignment="Bottom">
                                            <TextBlock.RenderTransform>
                                                <TranslateTransform Y="-1" />
                                            </TextBlock.RenderTransform></TextBlock>
                                    </Grid>
                                </Border>
                            </Grid>
                        </DataTemplate>
                    </ControlTemplate.Resources>
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
                        <Grid>
                            <ScrollViewer HorizontalScrollBarVisibility="Hidden"
                                          VerticalScrollBarVisibility="Hidden">
                                <ItemsControl x:Name="PART_VideoFrameItems"
                                              ItemTemplate="{StaticResource VideoFrameDataTemplate}">
                                    <ItemsControl.ItemsPanel>
                                        <ItemsPanelTemplate>
                                            <StackPanel Orientation="Horizontal" />
                                        </ItemsPanelTemplate>
                                    </ItemsControl.ItemsPanel>
                                </ItemsControl>
                            </ScrollViewer>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>